<?php

/**
 * 开发者自定义函数文件
 */


function titleurl($data) {
    $arr = ["?","!",",",".","~",':'];
    $py = str_replace(" ", "-", $data['title']);
    $py = str_replace($arr, "", $py);
    $url = "/".$py;
    dr_mkdirs(WRITEPATH.'myid/'); // 创建id缓存存储目录
    file_put_contents(WRITEPATH.'myid/'. md5(trim($url, '/')).'.txt', $data['id']); // 将id号存储缓存文件

    return $url; // 返回我自己的url规则：/pinyin.html
}